home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / tcqbsnip.zip / SHUFFLE.BAS < prev    next >
BASIC Source File  |  1997-06-20  |  493b  |  20 lines

  1. ' SHUFFLE.BAS
  2. ' by Tika Carr
  3. ' (date unknown)
  4. '
  5. ' Donated to the Public Domain
  6. ' No warranties or guarantees are expressed or implied.
  7. '
  8. ' Purpose: Demonstrates how to make Pseudo-random numbers that don't repeat.
  9.  
  10. RANDOMIZE TIMER
  11. DIM cards(52)
  12.  
  13. CLS
  14. FOR i = 1 TO 52: cards(i) = i: NEXT         'load cards
  15. FOR i = 1 TO 52                             'randomize cards
  16.   r = RND * 51 + 1: SWAP cards(r), cards(i)
  17. NEXT
  18. FOR i = 1 TO 52: PRINT cards(i), : NEXT     'Print cards
  19.  
  20.